#include "Sort.h"

void TestInsertSort()
{
	int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	InsertSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestShellSort()
{
	int a[] = { 9,1,2,5,7,4,8,6,3,0 };
	PrintArray(a, sizeof(a) / sizeof(int));
	ShellSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestSelectSort()
{
	int a[] = { 9,1,2,5,7,4,0,8,6,3 };
	SelectSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestBubbleSort()
{
	int a[] = { 9,1,2,5,7,4,0,8,6,3 };
	BubbleSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestQuickSort()
{
	//int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	//int a[] = { 6,1,2,7,9,3,4,5,10,8 };
	int a[] = { 2,2,2,2,2,2,2,2,2,2 };
	//int a[] = { 6,1,6,7,6,6,4,5,6,8 };
	QuickSort(a, 0, (sizeof(a) / sizeof(int)) - 1);
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestQuickSortNonR()
{
	//int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	int a[] = { 6,1,2,7,9,3,4,5,10,8 };
	QuickSortNonR(a, 0, (sizeof(a) / sizeof(int)) - 1);
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestMergeSort()
{
	//int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	int a[] = { 6,1,2,7,9,3,4,5,10,8 };
	MergeSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestMergeSortNonR()
{
	int a[] = { 6,1,2,7,9,3,4,5,10,8 };
	//int a[] = { 10,6,7,1,3,9,4,2 };
	MergeSortNonR(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}

void TestCountSort()
{
	int a[] = { 3,5,4,2,7,9,8,5,2,5,8};
	PrintArray(a, sizeof(a) / sizeof(int));
	CountSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}
int main()
{
	//TestInsertSort();
	//TestShellSort();
	//TestSelectSort();
	//TestBubbleSort();
	//TestQuickSort();
	//TestQuickSortNonR();
	//TestMergeSort();
	//TestMergeSortNonR();
	TestCountSort();

	return 0;
}